package com.itheima.dao;

import java.io.FileReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Properties;

public class LoginDao {

    public boolean login(String username, String password) {
        Properties pro=new Properties();
        boolean flag=false;
        try {
            InputStream in = LoginDao.class.getClassLoader().getResourceAsStream("pro.properties");
            InputStreamReader isr=new InputStreamReader(in,"gbk");
            pro.load(isr);
            if (username.equals(pro.getProperty("username"))&&password.equals(pro.getProperty("password"))){
                flag= true;
            }
            System.out.println(pro);
        } catch (Exception e) {
            e.printStackTrace();
        }
        /*
        注释
         */
        return flag;
    }
}
